﻿#region Copyrights Notice
//©2009 Microsoft Corporation.  All rights reserved.
//This portal design is based on the design and some code from DropThings.com which is also licensed under an MS-PL license.
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.IO;
using System.Data;

using System.Xml;
using System.Xml.Linq;
using Microsoft.InformationSecurity.CISF.Portal.Business.PortalFramework;

namespace Microsoft.InformationSecurity.RiskManagement.ISRMWeb.Widgets
{
    public partial class QuickLinks : Weblets_AbstractControl
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            this.LoadQuickLinks(sender, e);
        }
        protected void LoadQuickLinks(object sender, EventArgs e)
        {
            this.ShowQuickLinks();
        }

        protected void ShowQuickLinks()
        {
            try
            {
                DataSet dataSet = new DataSet();
                dataSet.ReadXml(Server.MapPath("~/Widgets/QuickLinks.xml"));
                this.gridQuickLinks.DataMember = "QuickLink";
                this.gridQuickLinks.DataSource = dataSet;
                this.gridQuickLinks.DataBind();
            }
            catch
            {
                gridQuickLinks.Visible = false;
                lblResults.Text = "<img src='images/Error-32.png' width='32' align='middle'></img> " + "Error rendering Quick Links!";
            }
        }
        #region Weblet Override
        void OnDisplaySettingsChange(bool bDisplay)
        {
            SettingsPanel.Visible = bDisplay;
        }
        #endregion
    }
}